package com.onlyforfun.exchange.listner;

import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.view.View.OnLongClickListener;
import android.widget.TextView;

import com.onlyforfun.exchange.domain.TimePrice;
import com.onlyforfun.exchange.util.NumberParse;
import com.onlyforfun.exchange.view.ExchangeCalculateDialog;

public class OnLongClickRateListner implements OnLongClickListener {
	private FragmentActivity context;
	private TimePrice timepice;
	public OnLongClickRateListner(FragmentActivity context, TimePrice timepice) {
		this.context = context;
		this.timepice = timepice;
	}
	@Override
	public boolean onLongClick(View v) {
		TextView tv = (TextView) v;
		ExchangeCalculateDialog newFragment = new ExchangeCalculateDialog(timepice, NumberParse.parseMoneyDouble(tv.getText().toString()));
		newFragment.show(context.getSupportFragmentManager(), "");
		return true;
	}

}
